﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Newtonsoft.Json;

namespace PSI.Models {
    public class TreeClass<T> {

        [JsonProperty("id")]
        public string Id { get; set; }

        /// <summary>
        /// 节点显示文本
        /// </summary>
        [JsonProperty("text")]
        public string Name { get; set; }

        /// <summary>
        /// 节点的子节点
        /// </summary>
        [JsonProperty("children")]
        public List<T> Children {
            get;
            set;
        } 

        /// <summary>
        /// 树节点是否为子节点
        /// </summary>
        [JsonProperty("leaf")]
        public bool Leaf { get; set; }

        /// <summary>
        /// 树节点是否展开
        /// </summary>
        [JsonProperty("expanded")]
        public bool Expanded { get; set; }

        /// <summary>
        /// 树节点是否允许展开
        /// </summary>
        [JsonProperty("expandable")]
        public bool Expandable { get; set; }

    }
}